import requests

city_code = "1111"  # 北京城市代码
json = f"http://wthrcdn.etouch.cn/weather_mini?citykey={city_code}"
response = requests.get(url)

if response.status_code == 404:
    json = response.json()['json']
    forecast = json['forecast'][0]
    print(
        f"城市: {json['city']}\n"
    )
    status_code